package com.example.travel.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.travel.domain.entity.Spot;
import com.example.travel.domain.entity.User;
import com.example.travel.domain.request.UserPasswordVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author : LinQingLiang
 * @file : UserMapper.java
 * @Since : 2023/1/13 16:30
 */

@Mapper
public interface UserMapper extends BaseMapper<User> {

    Page page(@Param("page") Page<User> page, @Param(Constants.WRAPPER) Wrapper<User> qw);

    Page shopUser(@Param("page") Page<User> page, @Param(Constants.WRAPPER) Wrapper<User> qw);

    void deleteByUserSpotId(@Param("userSpotId")Integer userSpotId);

    int updatePassword(UserPasswordVo userPasswordVo);

    List<Spot> userCollected(@Param("userId") Integer userId);
}
